﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace UtfprLibrary.Windows.Forms.ComponentModel {
    internal partial class UtfprFormPickerEditor : Form {
        #region Properties

        private object _value;
        public object Value {
            get { return _value; }
        }

        #endregion

        #region Contructors

        public UtfprFormPickerEditor() {
            InitializeComponent();
        }

        #endregion

        #region Event Handlers

        private void _btnOK_Click(object sender, EventArgs e) {
            if (_bsUtfprComponentDescription.Current != null) {
                _value = ((UtfprComponentDescription)_bsUtfprComponentDescription.Current).Type;
            }
        }

        #endregion

        #region Public Methods

        public void FillDataGrid(List<UtfprComponentDescription> componentList) {
            _bsUtfprComponentDescription.DataSource = typeof(UtfprComponentDescription);
            _bsUtfprComponentDescription.DataSource = componentList;
        }

        #endregion
    }
}
